<template>
  <BaseDialogTableSelect ref="dialogTableSelect" @selection-change="handleSelectionChange" v-bind="$attrs">
    <template #queryItems="{queryParams}">
      <el-form-item label="姓名" prop="name">
        <el-input
          v-model="queryParams.name"
          placeholder="请输入姓名"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
    </template>
    <template v-slot:tableColumns>
      <el-table-column label="姓名" align="center" prop="name"/>
      <el-table-column label="身份证号" align="center" prop="idCard"/>
      <el-table-column label="性别" align="center" prop="sex" width="100" show-tooltip-when-overflow>
        <template slot-scope="scope">
          <dict-tag :options="dict.type.sys_user_sex" :value="scope.row.sex"/>
        </template>
      </el-table-column>
      <el-table-column label="学科" align="center" prop="subject" width="100" show-tooltip-when-overflow>
        <template slot-scope="scope">
          <dict-tag :options="dict.type.jy_subject" :value="scope.row.subject"/>
        </template>
      </el-table-column>
      <el-table-column label="电话" align="center" prop="phone"/>
    </template>
  </BaseDialogTableSelect>
</template>

<script>
  import BaseDialogTableSelect from '@/components/BaseDialogTableSelect/index.vue'
  import {listJyTeacher, getJyTeacher, delJyTeacher, addJyTeacher, updateJyTeacher} from "@/api/research/jyTeacher"

  export default {
    name: "JyTeacherSelect",
    components: {BaseDialogTableSelect},
    dicts: ['sys_user_sex', 'jy_subject'],
    data() {
      return {
        open: false,
        loading: false
      }
    },
    methods: {
      show() {
        this.$refs.dialogTableSelect.show()
      },
      handleSelectionChange(select) {
        this.$emit("selection-change", select)
      },
      getList(queryParams) {//数据查询
        return listJyTeacher(queryParams)
      },
      getRowKey(item) {
        return item.idCard
      }
    }
  }
</script>

<style scoped>

</style>
